/**
 * Copyright (C) 2013 Denatics Development
 * 
 * Programmed by David Tiersch <dtiersch@denatics.com>
 * 
 * This file is part of B0mberman.
 * 
 * B0mberman is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * B0mberman is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with B0mberman. If not, see <http://www.gnu.org/licenses/>.
 */
package com.denatics.bomberman.control;

/**
 * This Class remembers the Action performed on the keyboard.
 * 
 * @author dtiersch
 */
public final class KeyAction {

    /**
     * Key-ID.
     */
    private final int key;

    /**
     * State of the Key.
     */
    private final boolean stat;

    /**
     * Generates the KeyAction.
     * 
     * @param keyid
     *            ID of the Key which changed
     * @param pressed
     *            if the Key has been pressed (true) or released (false)
     */
    public KeyAction(final int keyid, final boolean pressed) {
        this.key = keyid;
        this.stat = pressed;
    }

    /**
     * Returns, if the Key has been pressed or released.
     * 
     * @return true if pressed
     */
    public boolean isPressed() {
        return this.stat;
    }

    /**
     * Returns the KeyID of the Key that has been pressed or released.
     * 
     * @return KeyID
     */
    public int getKeyID() {
        return this.key;
    }

}
